//
//  CommonMethodTool.m
//  TheVideoClip
//
//  Created by 北斗君合MacMini on 2018/3/30.
//  Copyright © 2018年 北斗君合MacMini. All rights reserved.
//

#import "CommonMethodTool.h"

@implementation CommonMethodTool

+ (UIColor *)getRandomColorWithAlpha:(CGFloat)alpha {
    
    int redValue = arc4random_uniform(1 + 250);
    int greenValue = arc4random_uniform(1 + 250);
    int blueValue = arc4random_uniform(1 + 250);
    return kColorRGB(redValue, greenValue, blueValue, alpha);
}

+ (CGFloat)getTextWidthWithFont:(CGFloat)fontSize text:(NSString *)text {
    return [text boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:fontSize]} context:nil].size.width;
}

@end
